<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
	<th:block th:include="include :: header('供应商统计报表')" />

</head>

<body class="gray-bg">
<div class="container-div">
	<div class="row">
		<div class="col-sm-12 search-collapse">
			<form id="role-form">
				<div class="select-list">
					<ul>
						<li>
							<label>供货商名称：</label>
							<!--<input type="text" name="unitName"/>-->
							<select name="supplierId"  id="supplierId">
								<!--<c:forEach items="${lists}" var="list">-->
									<!--<option th:each="list:${suppliers}" th:value="${list.supplierId}" th:if ="${list.supplierId == supplier.supplierId }">selected="selected"</:if>>${list.supplierName}</option>-->
								<option th:each="qishu : ${suppliers}" th:text="${qishu['supplierName']}" th:value="${qishu['supplierId']}" ></option>
								<!--</c:forEach>-->
							</select>
						</li>
						<li class="select-time">
							<label>创建时间： </label>
							<input type="text" class="time-input" id="beginDate" placeholder="开始时间" name="beginDate"/>
							<span>-</span>
							<input type="text" class="time-input" id="endDate" placeholder="结束时间" name="endDate"/>
						</li>

						<li>
							<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
							<a class="btn btn-warning btn-rounded btn-sm" onclick="resetPre()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
						</li>
					</ul>
				</div>
			</form>
		</div>

		<div class="col-sm-12 select-table table-striped">
			<table id="bootstrap-table"></table>
		</div>



	</div></div>

<th:block th:include="include :: footer" />

<script th:inline="javascript">

	var prefix = ctx + "system/getReportAction";
	var lists = [[${lists}]];
	$(function() {
		var options = {
			// url: prefix + "/querySupplierRecord",
			/*queryParams: queryParams,*/
			data:lists,
			modalName: "供应商信息",
			columns: [{
				checkbox: true
			},
				{
					field: 'supplierName',
					title: '供应商名称',
				},
				{
					field: 'goodName',
					title: '货物名称',
				},
				{
					field: 'model',
					title: '型号'
				},
				{
					field: 'unitName',
					title: '采购单位'
				}
				,
				{
					field: 'number',
					title: '数量'
				},
				{
					field: 'createTime',
					title: '时间'
				},
				{
					field: 'winPrice',
					title: '中标价格(元)'
				},
				{
					field: 'dealPrice',
					title: '成交价格(元)'
				},
				{
					field: 'attribite3',
					title: '折扣率(%)'
				},
				]
		};
		$.table.init(options);
	});
	function queryParams(params) {
		var search = $.table.queryParams(params);
		search.supplierId = $("#supplierId").val();

		return search;
	}

	function resetPre() {
		$.form.reset();
		$("#supplierId").val($("#supplierId").val()).trigger("change");

	}


</script>

</body></html>